#include <bits/stdc++.h>
using namespace std;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
using ll = long long;
bool cmp(ll a, ll b )
{
    return a > b;
}
void solve()
{
    vector<ll> a(30);
    for (ll i = 0; i < 29;i++)
    {
        ll x;
        cin >> x;
        a.push_back(x);
    }
    ll v,pos;
    cin >> v;
    a.push_back(v);
    sort(a.begin(), a.end(), cmp);
    for (ll i = 1; i <= 30;i++)
    {
        if(a[i-1]==v)
        {
            pos = i;
            break;
        }
    }
    double ans = pos / 30.0;
    if(ans<=0.1)
        cout << 1 << endl;
    else if(ans<=0.3)
        cout << 2 << endl;
        else if(ans<=0.6)
            cout << 3 << endl;
            else
                cout << 4 << endl;
}
int main()
{
    int t = 1;
   // cin >> t;
    while(t--)
    {
        solve();
    }
   return 0;
}
